Skip to content

Add Swagger UI#22

Open
efcasado wants to merge 1 commit intoelixir-maru:masterfrom
efcasado:swagger-ui
Open

Add Swagger UI#22
efcasado wants to merge 1 commit intoelixir-maru:masterfrom
efcasado:swagger-ui

Conversation

@efcasado
Copy link
Copy Markdown
Contributor

This pull-request is all about seamlessly adding support for Swagger UI.

With this changes, all maru projects using this plug will not only be able to get the Swagger specification of their APIs, but they will also be able to tinker with it using Swagger UI.

This pull-request includes some breaking changes. For instance, the at option in the swagger macro does not longer refer to the endpoint where the Swagger specification can be found. Instead, it now points to the endpoint where the Swagger UI can be loaded. The swagger specification can be fetched by appending /swagger.json to the path provided in at.

You can find a toy application using these changes in https://github.com/efcasado/hola_maru

@falood
Copy link
Copy Markdown
Member

falood commented Mar 12, 2018

Hi @efcasado
Thank you very much for this pr, it's really a good option to have an internal swagger ui.
Do you think it's better to make maru-swagger-ui a standalone repo? I think it will be good to provide both api-only and ui-included option.

@efcasado
Copy link
Copy Markdown
Contributor Author

Hi @falood

I first considered creating a separate repo for this but after reviewing the code I thought it would be quite elegant to include the functionality in this repo. What would be your main concern in doing this? the size of the dependency (e.g. priv folder)? the breaking changes to the API?

How do you suggest to move forward? Should I just create a maru_swagger_ui_repo and push my changes there?

@falood
Copy link
Copy Markdown
Member

falood commented Mar 13, 2018

@efcasado

The dependency size is an important reason.

For another reason, I think we shouldn't put code NOT make by us in our repo, for the html/css/js files, I think we should have a script or package manager like webpack or brunch to fetch them from official source and generate what we need to the priv folder, and then push generated code to hex.pm.

do you think this way make sence?

I have create a new repo https://github.com/elixir-maru/maru-swagger-ui , really glad to have your changes there

Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants